﻿using App.Models;
using App.TestApi.Controllers.Todos.Dto;
using App.TestApi.Models;
using AutoMapper;
using Microsoft.AspNetCore.Mvc;

namespace App.TestApi.V2Controllers.Todos {
    public class TodoController : AppController {
        private readonly ILogger<TodoController> _logger;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="mapper"></param>
        public TodoController(ILogger<TodoController> logger,
            IMapper mapper) : base(mapper)

        {
            _logger = logger;
        }

        [HttpGet]
        [ApiVersionCustom(AppApiVersion.V2)]
        public AppResponse<TodoDto> Get()
        {
            var info = new Todo();
            info.id = 1;
            info.Title = "v2 ";
            info.IsComplete = false;

            var resultDto = _mapper.Map<TodoDto>(info);

            return resultDto;
        }
    }
}
